package title;

import java.util.Scanner;

/**
 * 功能：
 * 作者：lc
 * 日期：2024/12/1 2:54
 */
public class MainP1425_01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int d = scanner.nextInt();
        int x=c-a;
        int y=d-b;
        if (y<0){
            x--;
            y+=60;
        }
        System.out.println(x+" "+y);
    }
}
